package com.carol.lmsbe.dto;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 易耗品统计响应
 */
@Data
public class ConsumableStatisticsResponse {

    // 计划统计
    private Long totalPlans;
    private Long approvedPlans;
    private Long pendingPlans;
    private Long rejectedPlans;

    // 领用统计
    private Long totalReceives;
    private Long plannedReceives;
    private Long unplannedReceives;
    private Long totalQuantity;

    // 按实验室统计
    private List<LaboratoryConsumption> laboratoryConsumption;

    // 按学期统计
    private List<SemesterConsumption> semesterConsumption;

    // 消耗趋势
    private List<ConsumptionTrend> consumptionTrends;

    // 预算统计
    private BigDecimal totalBudget;
    private BigDecimal usedBudget;
    private BigDecimal remainingBudget;

    // 计划vs实际对比
    private List<PlanVsActual> planVsActual;

    @Data
    public static class LaboratoryConsumption {
        private String laboratoryName;
        private Long planCount;
        private Long receiveCount;
        private BigDecimal totalBudget;
        private BigDecimal usedAmount;
    }

    @Data
    public static class SemesterConsumption {
        private String semester;
        private Long planCount;
        private Long receiveCount;
        private BigDecimal totalBudget;
        private BigDecimal usedAmount;
    }

    @Data
    public static class ConsumptionTrend {
        private String month;
        private Long receiveCount;
        private Long totalQuantity;
        private BigDecimal totalAmount;
    }

    @Data
    public static class PlanVsActual {
        private String itemName;
        private Integer plannedQuantity;
        private Integer actualQuantity;
        private BigDecimal plannedAmount;
        private BigDecimal actualAmount;
        private String laboratoryName;
    }
}
